﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:ViewModels="clr-namespace:Beaker.OpenCube.WorldViewer.ViewModels"
		    xmlns:f="clr-namespace:Fluent;assembly=Fluent" 
                    xmlns:conv="clr-namespace:Beaker.OpenCube.Converters"
                    xmlns:ctrl="clr-namespace:Beaker.OpenCube.WorldViewer.Controls"
                    xmlns:wconv="clr-namespace:Beaker.OpenCube.WorldViewer.Converters">
    
	<DataTemplate DataType="{x:Type ViewModels:OpenTexturePackViewModel}">
		<DataTemplate.Resources>
			<wconv:GdiImageConverter x:Key="GdiImageConverter" />
		</DataTemplate.Resources>
		<ctrl:PopupDismissButton Background="{x:Null}" BorderBrush="{x:Null}" Margin="10" Padding="0" Command="{Binding OpenTexturePackCommand}">
			<Border Width="120" Height="120" Background="{StaticResource RibbonBackgoundBrush}" BorderThickness="1" BorderBrush="{StaticResource RibbonTopBorderBrush}">
				<Border.Resources>
					<BooleanToVisibilityConverter x:Key="BoolVisConverter" />
					<conv:BooleanConverter x:Key="InvBoolVisConverter" TrueValue="{x:Static Visibility.Collapsed}" FalseValue="{x:Static Visibility.Visible}" />
					<wconv:TimeToYCoordConverter x:Key="TimeToYCoordConverter" />
				</Border.Resources>
				<Grid>
					<Grid.RowDefinitions>
						<RowDefinition Height="*" />
						<RowDefinition Height="38" />
					</Grid.RowDefinitions>
					<Image Grid.RowSpan="2" Source="{Binding Image, Converter={StaticResource GdiImageConverter}}" />
					<Border Grid.Row="1" Padding="6,4" TextElement.Foreground="{StaticResource DefaultFontBrush}" Background="#88ffffff" BorderBrush="{StaticResource RibbonTopBorderBrush}" BorderThickness="0,1,0,0">
						<TextBlock Text="{Binding DisplayName}" TextWrapping="WrapWithOverflow" TextTrimming="CharacterEllipsis" />
					</Border>
				</Grid>
			</Border>
		</ctrl:PopupDismissButton>
	</DataTemplate>
	
</ResourceDictionary>